using UnityEngine;
using System.Collections;

public class Timer : MonoBehaviour {

	private float startTime;
	string textTime; //added this member variable here so we can access it through other scripts
	
	
	void Awake() {
	
	   startTime = Time.time;
	
	}
	
	void OnGUI () {
	
	   var guiTime = Time.time - startTime;
	
	   float minutes = guiTime / 60;
	   float seconds = guiTime % 60;
	   float fraction = (guiTime * 100) % 100;
	
	   textTime = string.Format ("{0:00}:{1:00}:{2:000}", minutes, seconds, fraction); 
	   GUI.Label (new Rect (400, 25, 100, 30), textTime); //changed variable name to textTime -->text is not a good variable name since it has other use already
	
	}
}
